<template>
  <div>
    <van-tabbar v-model="active">
      <van-tabbar-item to="/nearby" icon="home-o">附近</van-tabbar-item>
      <van-tabbar-item @click="getScan" icon="scan">扫码充电</van-tabbar-item>
      <van-tabbar-item to="/home" icon="user-o">我的</van-tabbar-item>
    </van-tabbar>

  </div>
</template>

<script>
export default {
  name: 'AppTabbar',
  data () {
    return {
      show: false,
      chargingList: []
    }
  },
  computed: {
    active: { // 用这种方法可以解决多次点击出现错误情况
      get () {
        return this.$route.meta.activeNum
      },
      set () {}
    },
    user () {
      return this.$store.state.user || {}
    }
  },
  methods: {
    getScan () {
      this.$store.dispatch('getScan')
    }
  }
}
</script>

<style lang='less'>
.van-tabbar-item{

}
</style>
